.class public Lcom/brixd/niceapp/model/AlbumHolderModel;
.super Ljava/lang/Object;
.source "AlbumHolderModel.java"

# interfaces
.implements Ljava/io/Serializable;


# instance fields
.field public albumDescription:Ljava/lang/String;

.field public albumId:I

.field public albumImageUrl:Ljava/lang/String;

.field public albumTitle:Ljava/lang/String;

.field public appModels:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/AppModel;",
            ">;"
        }
    .end annotation
.end field

.field public textBgColor:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 14
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static parseAlbumAppsHolderModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/AlbumHolderModel;
    .registers 4
    .param p0, "jsonObject"    # Lorg/json/JSONObject;

    .prologue
    .line 43
    new-instance v0, Lcom/brixd/niceapp/model/AlbumHolderModel;

    invoke-direct {v0}, Lcom/brixd/niceapp/model/AlbumHolderModel;-><init>()V

    .line 44
    .local v0, "albumHolderModel":Lcom/brixd/niceapp/model/AlbumHolderModel;
    const-string v2, "id"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v2

    iput v2, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->albumId:I

    .line 45
    const-string v2, "title"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->albumTitle:Ljava/lang/String;

    .line 46
    const-string v2, "digest"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->albumDescription:Ljava/lang/String;

    .line 47
    const-string v2, "cover_image"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->albumImageUrl:Ljava/lang/String;

    .line 48
    const-string v2, "rgb"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->textBgColor:Ljava/lang/String;

    .line 50
    const-string v2, "apps"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v1

    .line 51
    .local v1, "jsonArray":Lorg/json/JSONArray;
    if-eqz v1, :cond_3b

    .line 52
    invoke-static {v1}, Lcom/brixd/niceapp/model/AppModel;->parseAlbumApps(Lorg/json/JSONArray;)Ljava/util/List;

    move-result-object v2

    iput-object v2, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->appModels:Ljava/util/List;

    .line 55
    :cond_3b
    return-object v0
.end method

.method public static parseAlbumHolderModels(Lorg/json/JSONArray;)Ljava/util/List;
    .registers 6
    .param p0, "jsonArray"    # Lorg/json/JSONArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONArray;",
            ")",
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/AlbumHolderModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 22
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 23
    .local v1, "albumHolderModels":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/model/AlbumHolderModel;>;"
    if-nez p0, :cond_8

    .line 39
    :cond_7
    return-object v1

    .line 26
    :cond_8
    const/4 v2, 0x0

    .local v2, "i":I
    :goto_9
    invoke-virtual {p0}, Lorg/json/JSONArray;->length()I

    move-result v4

    if-ge v2, v4, :cond_7

    .line 27
    new-instance v0, Lcom/brixd/niceapp/model/AlbumHolderModel;

    invoke-direct {v0}, Lcom/brixd/niceapp/model/AlbumHolderModel;-><init>()V

    .line 28
    .local v0, "albumHolderModel":Lcom/brixd/niceapp/model/AlbumHolderModel;
    invoke-virtual {p0, v2}, Lorg/json/JSONArray;->optJSONObject(I)Lorg/json/JSONObject;

    move-result-object v3

    .line 30
    .local v3, "jsonObject":Lorg/json/JSONObject;
    const-string v4, "title"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->albumTitle:Ljava/lang/String;

    .line 31
    const-string v4, "digest"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->albumDescription:Ljava/lang/String;

    .line 32
    const-string v4, "cover_image"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->albumImageUrl:Ljava/lang/String;

    .line 33
    const-string v4, "id"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v4

    iput v4, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->albumId:I

    .line 34
    const-string v4, "rgb"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v0, Lcom/brixd/niceapp/model/AlbumHolderModel;->textBgColor:Ljava/lang/String;

    .line 36
    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 26
    add-int/lit8 v2, v2, 0x1

    goto :goto_9
.end method
